package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.junsi.bean.Newrecord;
import com.junsi.mapper.NewrecordMapper;
import com.junsi.service.NewrecordService;

@Service
public class NewrecordServiceImpl implements NewrecordService {

	@Autowired
	private NewrecordMapper newrecordMapper;
	
	@Override
	public Newrecord findById(Integer id) {
		
		return newrecordMapper.findById(id);
	}

	@Override
	public List<Newrecord> findByAll() {
		
		return newrecordMapper.findByAll();
	}

	@Override
	public boolean save(Newrecord newrecord) {
		
		int i = newrecordMapper.save(newrecord);
		if(i == 1){
			return true;
		}
		
		return false;
	}

	@Override
	public boolean update(Newrecord newrecord) {
		
		int i = newrecordMapper.update(newrecord);
		if(i == 1){
			return true;
		}
		return false;
	}

	@Override
	public boolean delete(Integer id) {
		int i = newrecordMapper.delete(id);
		if(i == 1){
			return true;
		}
		return false;
	}

	@Override
	public List<Newrecord> findByClientId(Integer id) {
		
		return newrecordMapper.findByClientId(id);
	}

	@Override
	public Newrecord findByClientIdAndDate(Integer id) {
		
		return newrecordMapper.findByClientIdAndDate(id);
	}

}
